<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
/*******basic*******/
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('basic',$postdata);
		$shopset=plugin('jy_weishop')->plugin_setting('shopset');
		$shopset['yuejie_open']=$postdata['yuejie_open'];
		$shopset['yuejie_price']=$postdata['yuejie_price'];
		plugin('jy_weishop')->plugin_setting('shopset',$shopset);
		exi('设置成功');
	}
	$footernav =array(
		array('title'=>'管理中心','icon'=>'icon-shouye','action'=>'jy_yuejie/index/'),
		array('title'=>'我的订单','icon'=>'icon-wo1','action'=>'jy_yuejie/order.list/'),
	);
	$return['item']=$this->plugin_setting('basic');
	$return['item']['footernav']=$return['item']['footernav']?$return['item']['footernav']:$footernav;
	$shopset=plugin('jy_weishop')->plugin_setting('shopset');
	$return['item']['yuejie_open']=$shopset['yuejie_open'];
	$return['item']['yuejie_price']=$shopset['yuejie_price'];
	$htmls=array(
		'type'=>'edit',
		'desc'=>'参数设置',
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'基本信息',
				'list'=>array(
					array('type'=>'tip','title'=>'[温馨提示]：我的设置--参数设置--注册设置--短信验证码模板ID（填了后，前端手机才会出现短信认证要求）'),
					array('type'=>'string','title'=>'网站名称','name'=>'title'),
					array('type'=>'image','title'=>'网站logo','name'=>'logo'),
					array('type'=>'string','title'=>'分享标题','name'=>'share_title'),
					array('type'=>'image','title'=>'分享图片','name'=>'share_image'),
					array('type'=>'string','title'=>'分享描述','name'=>'share_desc'),
				)
			),
			array(
				'title'=>'月结设置',
				'list'=>array(
					array('type'=>'switch','title'=>'是否启用','name'=>'yuejie_open','isradio'=>1),
					array('type'=>'unitstring','unit'=>'元/年','title'=>'月结会员年费','name'=>'yuejie_price'),
					array('name'=>'shoplevel_id','title'=>'绑定商城会员等级','type'=>'select','options'=>'shoplevels'),
					//array('type'=>'unitstring','unit'=>'元/起','title'=>'默认订单金额超N元需月结客户的管理员审核','name'=>'yuejie_cfee','help'=>'企业用户分为管理员，企业公司各办公人员，凡这批人员报修、采购可赊帐，统一由管理员开票结帐。可为管理员单位设置审批权限，比如超1000元以上由管理员审批'),
				)
			),
			array(
					'title'=>'申请协议',
					'list'=>array(
						array('type'=>'switch','title'=>'申请月结需要审核?','name'=>'become_check'),
						array('type'=>'string','title'=>'协议名称','name'=>'applytitle'),
						array('type'=>'richtext','title'=>'协议内容','name'=>'applycontent'),			
					)
			),
			array(
				'title'=>'底部导航',
					'list'=>array(
									array('type'=>'array','name'=>'footernav','add_tip'=>'添加一个底部导航',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标'),
										array('type'=>'string','name'=>'action','title'=>'导航链接'),							
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标','help'=>'图标，例如：icon-shouye'),							
										array('type'=>'link','name'=>'action','from'=>'action','title'=>'导航链接'),
									)
								),
					)
			),
		),
	);
	$return['shoplevels']=pdo_getall('jy_weishop_member_level',array('uniacid'=>$_SESSION['uniacid'],'merchid'=>0),array('id','title'),'id');
	$return['htmls']=$htmls;
	exi($return);
}
/*******basic*******/
/*******op*******/
